//
//  MAddDeviceCell.m
//  Mask
//
//  Created by 郭子一 on 2020/10/4.
//  Copyright © 2020 郭子一. All rights reserved.
//

#import "MAddDeviceCell.h"

@implementation MAddDeviceCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = UIColor.clearColor;
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    __weak typeof(self) weakSelf = self;
    self.titleLab = [UILabel new];
    self.titleLab.font = JSS_FONT_4;
    self.titleLab.textColor = RGB_VALUE(0x0F2118);
    [self.contentView addSubview:self.titleLab];
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(25);
        make.width.mas_equalTo(100);
        make.centerY.mas_equalTo(weakSelf.mas_centerY);
        make.top.bottom.offset(0);
    }];
    
    self.rightLab = [UILabel new];
    self.rightLab.font = JSS_FONT_2;
    self.rightLab.textColor = RGB_VALUE(0x00C3FE);
    [self.contentView addSubview:self.rightLab];
    [self.rightLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-29);
        make.height.mas_equalTo(22);
        make.centerY.mas_equalTo(weakSelf.mas_centerY);
//        make.top.bottom.offset(0);
    }];
    [self.rightLab setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
    self.rightLab.layer.backgroundColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0].CGColor;
    self.rightLab.layer.cornerRadius = 10;
    self.rightLab.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:192/255.0 blue:254/255.0 alpha:0.15].CGColor;
    self.rightLab.layer.shadowOffset = CGSizeMake(0,2);
    self.rightLab.layer.shadowOpacity = 1;
    self.rightLab.layer.shadowRadius = 15;
    
    self.lineView = [UIView new];
    self.lineView.backgroundColor = RGB_VALUE(0xDEDEDE);
    [self.contentView addSubview:self.lineView];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(25);
        make.right.offset(-25);
        make.height.mas_equalTo(0.5);
        make.bottom.offset(-0.5);
    }];
    
}

@end
